package com.fr.chart.axis;

import com.fr.base.core.json.JSONException;
import com.fr.base.core.json.JSONObject;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.chart.DataSeriesCondition;
import com.fr.chart.base.equals.Equals;

public class SeriesAttrContents
  implements DataSeriesCondition
{
  private static final long serialVersionUID = -1909328717512675726L;
  public static final String XML_TAG = "SeriesAttrContents";
  private String seriesLabel = null;
  private boolean isShowGuidLine = false;

  public SeriesAttrContents()
  {
  }

  public SeriesAttrContents(String paramString)
  {
    this.seriesLabel = paramString;
  }

  public void setSeriesLabel(String paramString)
  {
    this.seriesLabel = paramString;
  }

  public String getSeriesLabel()
  {
    return this.seriesLabel;
  }

  public void setShowGuidLine(boolean paramBoolean)
  {
    this.isShowGuidLine = paramBoolean;
  }

  public boolean isShowGuidLine()
  {
    return this.isShowGuidLine;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if (paramXMLableReader.isChildNode())
    {
      String str1 = paramXMLableReader.getTagName();
      if (str1.equals("Attr"))
      {
        String str2;
        if ((str2 = paramXMLableReader.getAttr("showLine")) != null)
          this.isShowGuidLine = Boolean.valueOf(str2).booleanValue();
        if ((str2 = paramXMLableReader.getAttr("seriesLabel")) != null)
          this.seriesLabel = str2;
      }
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("SeriesAttrContents");
    paramXMLPrintWriter.startTAG("Attr").attr("showLine", this.isShowGuidLine);
    if (this.seriesLabel != null)
      paramXMLPrintWriter.attr("seriesLabel", this.seriesLabel);
    paramXMLPrintWriter.end();
    paramXMLPrintWriter.end();
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof SeriesAttrContents))
      return false;
    SeriesAttrContents localSeriesAttrContents = (SeriesAttrContents)paramObject;
    if (localSeriesAttrContents.isShowGuidLine != this.isShowGuidLine)
      return false;
    return (Equals.equals(localSeriesAttrContents.seriesLabel, this.seriesLabel));
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    SeriesAttrContents localSeriesAttrContents = (SeriesAttrContents)super.clone();
    if (this.seriesLabel != null)
      localSeriesAttrContents.setSeriesLabel(this.seriesLabel);
    return localSeriesAttrContents;
  }

  public JSONObject toJSONObject()
    throws JSONException
  {
    JSONObject localJSONObject = new JSONObject();
    localJSONObject.put("seriesLabel", this.seriesLabel);
    localJSONObject.put("isShowGuidLine", this.isShowGuidLine);
    return localJSONObject;
  }

  public String getConditionType()
  {
    return "SeriesAttrContents";
  }
}